package com.knowledge.plus.java8.方法引用;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author TPF
 * @since 2024/7/11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
class Person {

    private String name;

    public void sayHello() {
        System.out.println("Hello, my name is " + this.name);
    }

    public static int compareByName(Person p1, Person p2) {
        return p1.getName().compareTo(p2.getName());
    }

    public String getName() {
        return this.name;
    }

}
